package com.itheima.controller;

import com.itheima.bean.Student;
import com.itheima.service.StudentServiceImpl;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class StudentController {
    StudentServiceImpl service = new StudentServiceImpl();

    @Test
    public void findAll() {
        List<Student> list = service.findAll();
        for (Student student : list) {
            System.out.println(student);
        }
    }

    @Test
    public void findByNameOrAge() {
        List<Student> list = service.findByNameOrAge("张三", 24);
        for (Student student : list) {
            System.out.println(student);
        }
    }

    @Test
    public void findCondition() {
        Student stu = new Student();
        stu.setName("张三");
        List<Student> list = service.findCondition(stu);
        for (Student student : list) {
            System.out.println(student);
        }
    }

    @Test
    public void findByIds() {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        List<Student> students = service.findByIds(list);
        for (Student student : students) {
            System.out.println(student);
        }
    }
}
